package request

type Register struct {
	Name      string `form:"name" json:"name" binding:"required" label:"用户名"`
	Mobile    string `form:"mobile" json:"mobile" binding:"required,mobile" label:"手机号"`
	Password  string `form:"password" json:"password" binding:"required" label:"密码"`
	Password2 string `form:"password2" json:"-" binding:"required,eqfield=Password" label:"重复密码"`
}

func (register Register) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"required": ":label不能为空",
		"mobile":   ":label格式不正确",
	}
}

type Login struct {
	Mobile   string `form:"mobile" json:"mobile" binding:"required,mobile" label:"手机号"`
	Password string `form:"password" json:"password" binding:"required" label:"密码"`
	Code     string `form:"code" json:"code" binding:"required" label:"验证码编号"`
	Captcha  string `form:"captcha" json:"captcha" binding:"required,max=5" label:"验证码"`
}

func (login Login) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"required": ":label不能为空",
		"mobile":   "请输入:label",
		"max":      "验证码错误",
	}
}
